package com.engc.stumng.web.newStudent;

import java.util.Map;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.engc.common.service.BaseService;
import com.engc.common.utils.BaseUtils;

/**
 * 新生个人信息认证
 * 
 * @author gxx
 * 
 */
@Controller
@RequestMapping("/person")
public class PersonController {

	@Resource
	private BaseService baseService;

	@RequestMapping("/view")
	public String view(HttpServletRequest request) {
		return "person/auth";
	}

	/**
	 * 修改认证信息
	 * 
	 * @param request
	 * @return
	 */
	@RequestMapping("/update")
	@ResponseBody
	public Map<String, Object> update(HttpServletRequest request) {
		Map<String, Object> record = BaseUtils.getUpdateParam(request);

		try {
			baseService.Update("t_auth_info", record, "id=?", record.get("id"));
			return BaseUtils.getSuccessMessage("修改成功");
		} catch (Exception e) {
			return BaseUtils.getErrorMessage("修改失败");
		}
	}
}
